package com.lzy.crm.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.lzy.crm.base.mybatis.BaseMapper;
import com.lzy.crm.base.mybatis.Example;
import com.lzy.crm.base.page.PageQuery;
import com.lzy.crm.base.service.BaseServiceImpl;
import com.lzy.crm.dao.GamePlayerRecordMapper;
import com.lzy.crm.dao.criteria.GamePlayerRecordCriteria;
import com.lzy.crm.domain.GamePlayerRecord;
import com.lzy.crm.service.GamePlayerRecordService;

/**
 * 玩家回放处理
 * @author Administrator
 *
 */
@Service("gamePlayerRecordService")
public class GamePlayerRecordServiceImpl extends BaseServiceImpl<GamePlayerRecord, GamePlayerRecordCriteria> implements GamePlayerRecordService {

	@Resource
	private GamePlayerRecordMapper gamePlayerRecordMapper;
	
	@Override
	public BaseMapper<GamePlayerRecord, GamePlayerRecordCriteria> getBaseMapper() {
		return gamePlayerRecordMapper;
	}
	
	/**
	 * 查询玩家战绩
	 * @param uid
	 * @return
	 */
	public List<GamePlayerRecord> getGamePlayerRecordList(String playerId,PageQuery pageQuery){
		/*Example<GamePlayerRecordCriteria> example = new Example<GamePlayerRecordCriteria>(GamePlayerRecordCriteria.class);
		GamePlayerRecordCriteria gamePlayerRecordCriteria = example.createCriteria();
		gamePlayerRecordCriteria.andPlayerIdEqualTo(playerId);*/
		return gamePlayerRecordMapper.getGamePlayerRecordList(playerId, pageQuery); 
	}
	
	
	/**
	 * 查询群玩家战绩
	 * @param uid
	 * @return
	 */
	public List<GamePlayerRecord> getGamePlayerRecordListByGroupId(String groupId,PageQuery pageQuery) {
		return gamePlayerRecordMapper.getGamePlayerRecordListByGroupId(groupId, pageQuery);
	}
	
	/**
	 * 根据房间查询回复记录
	 * @param playerId
	 * @return
	 */
	public List<GamePlayerRecord> getGamePlayerRecordListByRoomId(String roomId,String createTime) {
		Example<GamePlayerRecordCriteria> example = new Example<GamePlayerRecordCriteria>(GamePlayerRecordCriteria.class);
		GamePlayerRecordCriteria gamePlayerRecordCriteria = example.createCriteria();
		gamePlayerRecordCriteria.andRoomidEqualTo(roomId);
		gamePlayerRecordCriteria.andCreateTimeEqualTo(createTime);
		return gamePlayerRecordMapper.getListByExample(example); 
		
		
	}

}
